package com.yesep.learn.netty.tcp.protocol.impl.hj212_2017.command;

import com.yesep.learn.netty.tcp.protocol.common.CN_OPT;
import com.yesep.learn.netty.tcp.protocol.common.Constants;
import com.yesep.learn.netty.tcp.protocol.common.SYS_TYPE;
import com.yesep.learn.netty.tcp.protocol.exception.CommandParseException;
import com.yesep.learn.netty.tcp.protocol.session.Command;

/**
 * @Description: 请求应答
 */
public class Cmd9011 extends Command {

	public Cmd9011() {
	}

	public Cmd9011(String msg) throws CommandParseException {
		super(msg);
	}

	public Cmd9011( String ST, String PW, String MN, Integer Flag, Integer QnRtn) {
		super(SYS_TYPE.INTERACTIVE.getCode(), CN_OPT._9011.getCode(), PW, MN, Flag);
		this.setQnRtn(QnRtn);
	}

	public Integer getQnRtn() {
		String code = this.getCP().getParam(Constants.PARAM_QnRtn);
		if (null != code) {
			return Integer.valueOf(code);
		}
		return 0;
	}

	public void setQnRtn(Integer code) {
		this.getCP().addParam(Constants.PARAM_QnRtn, String.valueOf(code));
	}

}
